package com.atguigu.stgy.app.controller;


import com.atguigu.stgy.app.service.ApartmentInfoService;
import com.atguigu.stgy.model.dto.ApartmentDTO;
import com.atguigu.stgy.model.dto.ApartmentSearchDTO;
import com.atguigu.stgy.model.entity.ApartmentInfo;
import com.atguigu.stgy.model.result.R;
import com.atguigu.stgy.model.vo.ApartmentDetailVO;
import com.atguigu.stgy.model.vo.ApartmentVO;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/app/apartment")
public class ApartmentInfoController {
///app/apartment/getDetailById?id=10
    @Resource
    ApartmentInfoService apartmentInfoService;

    //http://localhost:8080/admin/apartment/getDetailById?id=9
    @Operation(summary = "id查询公寓详情")
    @GetMapping("getDetailById") //请求参数：pojo入参
    public R<ApartmentDetailVO> getDetailById(@RequestParam("id")Long id) {
        ApartmentDetailVO apartmentDetailVO = apartmentInfoService.getDetailById(id);
        return R.ok(apartmentDetailVO);
    }

}
